package com.ocom.common.request.emqx;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class DoorResponse {
	Integer code;
	Integer type = 0;
	String message;
	Object data;
	String transferId;
	Long timestamp;
	String checkStatus="200";
	String machNo="";
	String name="";

	public static DoorResponse success(Integer type,Object data,String transferId){
		return new DoorResponse(200,type,"success",data,transferId,new Date().getTime(),"200","","");
	}

	public static DoorResponse error(Integer code,String message,String transferId){
		return new DoorResponse(code,0,message,null,transferId,new Date().getTime(),"201","","");
	}

	public static DoorResponse error(String message,String transferId){
		return new DoorResponse(201,0,message,null,transferId,new Date().getTime(),"201","","");
	}

}
